
{% import xmanager %}
{% init sys_plugins = xmanager.find_plugins("system") %}
<div class="aside-item hide">
    <div class="aside-title">
        用户
    </div>
    <div class="aside-content">
        <ul>
            <li>{{_user_name}}</li>
            <!--
            <li>日期: <span class="currentDate"></span></li>
            <li>时间: <span class="currentTime"></span></li>
            -->
            {% if _has_login %}
                <li><a href="/logout">登出</a></li>
            {% else %}
                <li><a href="/login">登陆</a></li>
            {% end %}
        </ul>
    </div>
</div>

{% if len(sys_plugins) > 0 %}
    <div class="aside-item">
        <div class="aside-title">
            {{T("Options")}}
        </div>
        <div class="aside-content">
            <ul>
                {% for p in sys_plugins %}
                    <li><a href="/plugins/{{p.name}}">{{p.title}}</a></li>
                {% end %}
            </ul>
        </div>
    </div>
{% end %}

<div class="aside-item">
    <div class="aside-title">{{T("Time")}}</div>
    <div class="aside-content">
        <span class="currentDateTime"></span>
    </div>
</div>

<script type="text/javascript">
$(function () {
    function updateTime () {
        $(".currentTime").html(new Date().format("HH:mm:ss"));
        $(".currentDate").html(new Date().format("yyyy-MM-dd"));
        $(".currentDateTime").html(new Date().format("yyyy-MM-dd HH:mm:ss"));
        setTimeout(updateTime, 1000);
    }
    updateTime();
})


function runCommand(path) {
    // alert("runCommand "+ path);
    $.get("/system/command", {path: path}, function(data, status) {
        alert(data);
    })
}
</script>